package org.design.repeat.config;

import org.design.repeat.interceptor.impl.SameUrlDataInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * WebConfig
 *
 * @author 樊温军
 * @date 2025/6/23 上午11:06
 */
@Configuration
public class WebConfig implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        // 这里是判断重复请求的拦截器，需要拦截所有路径
        registry.addInterceptor(new SameUrlDataInterceptor()).addPathPatterns("/**");
    }
}